package com.jxd.service;

import com.jxd.entity.MesHead;
import com.jxd.entity.SelectionMess;
import com.jxd.entity.Switchover;
import com.jxd.model.SwitchCover;
import com.jxd.model.TwoMachineSwitchover;
import org.apache.hadoop.hbase.client.Connection;

import java.util.List;

/**
 * @author ZhaoyuZhang
 * @date 2020/07/27
 * 双机切换的接口类
 */
public interface TwoMachineSwitchoverService {
    //获取同发送设备名下的心跳报文 61456
    List<MesHead> getHeartbeatMesBysendDevice(String fileName, String shipId, String mesid);
    //获取 10 11 12 行数据
    List<Switchover> getMesContentByHeartbeatMess(List<MesHead> heartbeatMess, Connection connection, String tableName);

    //双机切换的判断类
    List<TwoMachineSwitchover> getTwoMachineSwitchovers(List<Switchover> mesContentByHeartbeatMess);

    //计算加电时间
    String getPowerOnTime(List<MesHead> heartbeatMess);

    //获取同接收设备名下的工作模式选择报文 41008
    List<MesHead> getSelectionMessBysendDevice(String fileName, String shipId, String mesid, String sendDevice);

    //获取切换的数组
    List<SelectionMess> getSelectionMessContent(List<MesHead> selectionMess,String bwTableName,Connection connection);

    //计算工作时间
    String getWorkingTime(List<SelectionMess> selectionMessContent);

    //回写入oracle
    void insertTwoMachineSwitchover(
            List<TwoMachineSwitchover> twoMachineSwitchovers,
            String workingTime,
            String powerOnTime,
            String shipid,
            String filename,
            String xtid
    );
}
